Program verification through symbolic enumeration of control path programs

ABSTRACT

Systems and methods are disclosed to verify a program by symbolically enumerating path programs; verifying each path program to determine if the path program is correct or leads to a violation of a correctness property; determining a conflict set from the path program if the path program is proved correct; using the conflict set to avoid enumerating other related path programs that are also correct.

This application claims priority to U.S. Provisional Application Ser. No. 61/078,565, filed Jul. 7, 2008, the content of which is incorporated by reference.

BACKGROUND

This application relates to methods for program verification through symbolic enumeration of control path programs.

Symbolic execution has been proposed as a method for generalizing dynamic testing. Initial work focused on generating test sets with better basic block coverage, not necessarily proving satisfiability of program assertions. Recently, work has been done towards using a symbolic execution engine in the refinement step of a predicate abstraction-based model checker. Conventional symbolic execution-based tools employ a combination of concrete and symbolic execution to systematically explore the paths of a given program. The symbolic execution of a given program path computes a set of constraints whose solutions provide inputs for executions along the path. Such inputs yield useful test cases for the program in order to discover potential bugs and to maximize code coverage. The unsatisfiability of the constraints computed along a path indicates the (semantic) unfeasibility of the chosen path. Symbolic execution approaches have been shown to be effective for test generation in order to cover large portions of the program and discover useful bugs in the process. However, the path explosion problem, wherein the large number of program paths to be explored results in numerous expensive satisfiability checks, frequently limits its applicability in practice. A significant fraction of the paths that contribute to the path explosion problem tends to be infeasible. Such paths do not contribute to the overall coverage goals, or lead to useful bugs. Therefore, they are mostly ignored by existing approaches. Secondly, techniques based on symbolic execution expose potential bugs in the programs but not necessarily indicate the absence of such bugs due to the incompleteness of the symbolic execution.

Path programs are syntactic paths in the MSCC graph between the start node and a given property node. They represent a set of syntactic paths through the original program, traversing the same subset of edges but varying in the number of iterations of loops/recurrences encountered in the path. Existing program analysis techniques are mostly path insensitive. This makes the results of the analysis imprecise, leading to problems such as false alarms. Path insensitivity is an important reason for failure to prove properties by static analysis techniques. A completely path sensitive analysis, however, does not scale. Many approaches have been proposed for path sensitive program analysis, including ESP, trace partitioning, elaborations, and others based on disjunctive completion. Significantly, the approaches detailed above allow partial path-sensitivity on top of an underlying framework for path-insensitive analysis. However, conventional approaches typically use heuristics to control the trade-off between performing a join operation as opposed to a logical disjunction at the merge points in the control flow graph. The performance of such heuristics can be highly variable depending on the type of the program being analyzed.

SUMMARY

Systems and methods are disclosed to verify a program by symbolically enumerating path programs; verifying each path program to determine if the path program is correct or leads to a violation of a correctness property; determining a conflict set from the path program if the path program is proved correct; using the conflict set to avoid enumerating other related path programs that are also correct.

In another aspect, a method to verify a program includes symbolically enumerating path programs; verifying each path program to determine correctness with respect to a property; determining a conflict set from the path program if proven correct; and using the conflict set to avoid enumerating related path programs that are correct.

In yet another aspect, a method to verify a program, comprising: enumerating depth bounded path programs; verifying each path program to determine correctness with respect to a property; determining a conflict set from the path program if proven correct; and using the conflict set to avoid verification of related path programs that are also correct.

In one embodiment, starting from a SAT formula φ₀ that encodes all the path programs in the CFG, the system extracts a single path program as a solution to the current formula φ_(i) If the given property is proven in this path program using abstract interpretation, the system computes a minimal subset of edges in the path that are responsible for the proof. As a result, all the other path programs that traverse the same subset of edges are guaranteed to also satisfy the property in question. Such paths need not be enumerated. The subset of edges that constitute the proof of a single path program is added as a blocking clause to the SAT formula φ_(i) to obtain the next SAT formula. If, on the other hand, abstract interpretation is unable to prove the property in the given path program, the path is presented as a potential witness or attempt to concretize along the path using more powerful model-checking techniques.

In another aspect, systems and methods are disclosed to verify a program by encoding path programs as a Boolean SAT formula with constraints; generating a Boolean SAT solver for the constraints; generating a path program instantiation from the Boolean SAT formula; applying a proof-producing static analysis to the path program instantiation; determining a conflict set from a flow analysis and one or more UNSAT cores; and applying a SAT Modulo Theory (SMT) solver on the conflict set computation.

In yet another aspect, systems and methods are disclosed for processing a computer program by extracting one or more unsatisfiable cores from one or more path constraints during a symbolic execution of the program; and mapping one or more symbolic constraints in the unsatisfiable cores to an infeasible edge conflict sequence in the computer program.

Advantages of the preferred embodiments may include one or more of the following. The system supports the removal of checks for many infeasible paths through matches with previously derived conflict sequences. The system also enables the sound handling of loops and the infeasible sequences arising out of loop iterations in the symbolic execution. The system also supports an extraction of unsatisfiable cores from path constraints during symbolic execution and the mapping of symbolic constraints in these cores to program edges to derive conflict sequences. Abstract interpretation/static analysis techniques can also be used to generate unsatisfiable cores for loops.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a path-sensitive program analysis process that enumerates control path programs.

FIG. 2 shows in more detail the conflict set determination process.

FIG. 3 shows an exemplary process 300 to determine the encoding for all path programs.

FIG. 4A shows an exemplary imperative program along with its CFG representation.

FIG. 4B shows an example program and its CFG representation.

FIG. 5 shows an exemplary process to learn and utilize conflict sequences derived from unsatisfiable cores, which are obtained from infeasible symbolic executions.

FIG. 6 shows in more detail an exemplary process in FIG. 5 that extracts the conflict sequence from constraints and program description.

DESCRIPTION

FIG. 1 shows a path-sensitive program analysis process that enumerates control path programs. Path programs are formed by a subset of edges in the control flow graphs. Each path program represents a set of executions, all of which traverse the same CFG path, but vary in the number of loop iterations. The enumeration of path programs is guided by a SAT formula whose solutions represent the set of path programs to be explored.

Referring now to FIG. 1, software to be tested is provided to a path program encoder 101 which encodes all path programs as a SAT formula. The encoding process consists of applying the definitions of a path program to the program input to the process. The encoding produces a Boolean SAT formula. Next, a Boolean SAT solver 102 is generated for the constraints produced by the encoder 101. The SAT-solver encodes and enumerates efficiently over all possible path programs. The system applies a SAT solver only for path program enumeration, on the CFG and rely on abstract interpretation for determining path program feasibility.

A path program instantiation is created from Boolean formula and provided to a proof-producing and sound static analyzer 103. Next, the static analysis proof is provided to a conflict set computation unit 104. Block 104 is explained in more detail in FIG. 2. The conflict set computation is then provided to a SAT Modulo Theory (SMT) solver 105 with support set and unsatisfiable core computation.

For each path program, an abstract interpretation is performed to prove the property of interest along the path. A proof of the property yields conflict sets consisting of a subset of the statements in the path program. The conflict sets represent sufficient reasons for the property to hold. Furthermore, any other compatible path program that visits the edges present in the conflict set is also guaranteed to satisfy the property. The system adds blocking clauses derived from the conflict set back to the SAT formula in order to avoid the enumeration of compatible path programs.

The system provides a simpler and more direct approach to path-sensitivity based on the symbolic enumeration of path programs. The maximal strongly connected component (MSCC) decomposition of a CFG is obtained by compacting loops and recurrences in the program into components. Path programs are syntactic paths in the MSCC graph between the start node and a given property node. They represent a set of syntactic paths through the original program, traversing the same subset of edges but varying in the number of iterations of loops/recurrences encountered in the path. The operations include symbolically enumerating all the (finitely many) path programs from the start node to a property node and verifying the property over each enumerated program using path-insensitive static analysis. The widening and narrowing operators are used to treat loops conservatively. At the termination of the analysis, the set of path programs that cannot be proven by the abstract interpreter are summarized and presented to the user or to a more complete verification procedure as potential witnesses. However, the number of path programs between the start node and given target node can be exponential in the size of the program. As a result, an explicit enumeration is impractical. The system addresses this in two ways. First, conflict sets are learned from the proof of a single path program from which the system learns and reuses in order to conclude a proof for other related path programs. Second, a SAT encoding of the set of path programs keeps track of the paths that remain to be explored in the process.

FIG. 2 shows in more detail the conflict set determination process. Block 201 determines an Initial Map by pruning invariants at the property node. The process checks if invariants in the current map have supporting antecedents in block 202. If so, the process outputs the map as the final pruned invariant set in block 203. Alternatively, block 204 locates an unsupported invariant and adds necessary antecedents back from the static analysis result. Block 204 then loops back to block 202 to check for invariants.

Referring now to FIG. 3, an exemplary process 300 is shown for determining the encoding for all path programs. The path encoding is performed by a control flow graph traversal. The result is a Boolean formula over variables y_1, . . . , y_n that correspond to the control flow graph edges e_1, . . . e_n. In block 301, the process checks if any paths remain to be analyzed. This is achieved by means of a SATisfiability check over the SAT formula that encodes the remaining paths to be explored. Next, in block 302, the process analyzes one of the remaining programs using abstract interpretation. The analysis over abstract interpretation is a standard procedure that can be performed by any of the existing abstract interpreters including F-Soft. Next, in block 303, the process checks for possible property violations. The check for a proof is direct from the output of the abstract interpretation.

If violations are possible, in block 304, the process computes the conflict set and removes all path programs that match the conflict from further consideration. Conflict sets are a subset of edges in the path program that are responsible for the property proofs. Since it is guaranteed that any other path program that visits the same subset of nodes will also satisfy the property, the system can remove all path programs that visit the conflict set. In terms of SAT encoding, the conflict set is added as a blocking clause. Alternatively, in block 305, the witnesses can be sliced and presented to the user. The removal of the path program is again performed as in (103) by conflict clauses.

For convenience, the following discussion focuses on programs without any procedure calls. Control-flow graphs (CFG) are used to represent programs.

Definition (Control Flow Graphs):A CFG

is a tuple <N, E, V, ρ, n₀, n_(e)>, wherein N is a set of nodes, E⊂N×N is a set of edges, n₀ ∈ N is an initial location, n_(e) ∈ N is an exit location, and V is a set of typed (global) program variables. Each edge e ∈ E is labeled by a transition relation ρ_(e)(V, V′), a first-order assertion over current-state variables V and next-state variables denoted by V′. A (concrete) execution through the CFG starts at the entry block with arbitrary initial values to the program variables, and terminates when it reaches the exit block.

Definition (property): A property to be verified is specified as a program assertion n, ψ consists of a node n in the CFG along with an assertion ψ over the program variables, requiring that ψ hold whenever control reaches the node n. FIG. 4 shows an example control flow graph of a program over integer-valued variables i, j, c, flag and pointer variables y, p.

A program assertion Ψ: n₁₂, (y≠0) requires that the value of y not equal zero when control reaches n₁₂. In this case, the assertion holds true on all the program executions. However, a path-insensitive abstract interpretation of the program using the interval domain is unable to prove the property due to the join operation at line 5, wherein the correlation between the variables is lost.

MSCC Decomposition:

Definition (Maximal Strongly Connected Components): Given a graph G:<N,E>, a strongly connected component (SCC) consists of a subset of nodes C⊂N such that for each n₁, n₂ ∈C, there exists a path from n₁ to n₂ and vice-versa. A strongly connected component C is maximal(MSCC) iff no strict superset of C is a strongly connected component. Given a graph G, its MSCC-decomposition consists of MSCCs C₁, . . . , C_(n) such that C_(i) ∩ C_(j)=Ø and C₁ ∩ C₂ ∪ . . . ∪ C_(n)=N. The MSCC decomposition of a graph can be computed in time linear to the size of the graph using a standard technique based on a DFS traversal. Furthermore, we may define a graph G_(D) over the MSCCs of G over the vertex set N(G_(D)):{C₁, . . . , C_(m)} consisting of the MSCCs of the graph G and edges connecting MSCCs as follows:

E(G _(D)):{((C _(i) ,C _(j))i≠j, and (∃n _(i) ∈C _(i) ,n _(j) ∈C _(j))(n _(i) ,n _(j))∈E(G)}.

The MSCC decomposition G_(D) of a graph G is a directed, acyclic graph. The MSCC decomposition of the CFG in FIG. 4 yields one non-trivial MSCC consisting of the nodes {8,10}. All the other nodes appear by themselves as MSCCs.

Let G:N, E be the CFG obtained from a program

. Its MSCC decomposition G_(D) compresses loops (and recurrences) in the CFG into a single representative node. Nodes in the CFG G that do not belong to loops appear as singleton sets in the decomposition G_(D).

Next, path programs are discussed.

Definition (Path Program): A path program π:n₀În is a simple path in G_(D) from the initial node n₀ to a given node n. path program π naturally corresponds to a subset of nodes and edges in G, obtained as the union of the MSCCs traversed by π.

An abstract interpretation framework is used to compute fixed points over program fragments that may traverse cycles in the program arbitrarily many times. If Σ denotes the universe of concrete program states, an abstract domain consists of a lattice L,

along with the abstraction map a: α:2^(Σ)

L, and the concretization map γ:L

2^(Σ). Each abstract object a ∈ L is associated with a set of states γ(a)⊂Σ. The maps α and γ together provide a Galois Connection between the concrete lattice 2^(Σ) and the abstract lattice L.

Next, a flow sensitive map is discussed. A flow-sensitive map η:B

L, associates each node b in the CFG with an abstract object η(b) ∈ L.

In a Fixed-Point Map (Inductive Map), a map η is a fixed point (inductive invariant) iff η(n₀)=T and at each location b and for each outgoing edge e: b→b′, the following containment holds:

∀e:(a→b)∈E)γ(η(a))[V]̂ρ(e)[V,V′]

(η(b))[V

V′]

A property n, φ for a program is proved iff there exists a fixed point η such that γ(η(n))

.

The goal of an abstract interpreter is to compute a fixed point flow sensitive map for given a program. This is achieved by starting with the initial map:

${\eta^{0}(b)}:\left\{ \begin{matrix} {T,} & {{b = b_{0}},} \\ {\bot,} & {{otherwise}.} \end{matrix} \right.$

At each step, the process computes a new map η^(i+1) iteratively from the map η^(i) by applying the post-condition operation:

${\eta^{i + 1}(b)}:\left\{ \begin{matrix} {T,} & {{b = b_{0}},} \\ {\coprod_{b^{\prime}\rightarrow b}} & {\left( {{\eta^{i}\left( b^{\prime} \right)},\left. b^{\prime}\rightarrow b \right.} \right).} \end{matrix} \right.$

The iteration is denoted as η^(i+1)=L (η^(i)). Starting from the initial map η⁰, the iteration is applied to produce a sequence of maps η¹, η², . . . . The iteration is terminated whenever η^(i+1)(b)⊂η^(i)(b), ∀b ∈ B. However, termination is not guaranteed, unless the lattice L satisfies the ascending chain condition. Therefore, the widening operator is used to guarantee convergence. Let η⁰, η¹, . . . be a sequence of iterations. A widened iteration sequence φ⁰,φ₁, . . . is computed using widening: φ⁰=η⁰, φ^(i+1)=φ^(i)η^(i+1). Using the properties of the widening operator, it can be shown that the sequence φ⁰,φ¹, . . . , converges to a fixed point map in a finite number of steps.

The interval domain is a simple yet widely used abstract domain. Let X be a set of program variables. The interval lattice I(X) consists of intervals: ̂_(x) _(i) _(∈X) x_(i) ∈[l,u], wherein l,u ∈∪{∞-∞}, mapping each program variable to an interval of values. The detailed description of the abstract domain including basic domain operations are readily defined over intervals. However, the variable ranges which result from abstract interpretation on the interval domain are relatively imprecise because of the lack of relational information between variables. For instance, the interval x∈[10,15] ̂γ∈E [4,15] does not state any formal relationship between the values of x and y. This is a serious limitation in practice.

Octagon Domain.

The octagon domain due to Miné consists of bounds on expressions of the form ±x_(i)±x_(j)0 for all pairs x_(i),x_(j) [20]. The focus on unit, two variable constraints gives rise to efficient representation as well as fast polynomial time algorithms for the domain operations. Furthermore, they improve upon interval analysis by computing weakly-relational invariants. The octagon domain provides some relational information among the variables by considering invariants involving expressions such as ±x±y with two variables and unit coefficients. On the other hand, this is inadequate in many situations wherein an invariant involving more than two variables and non-unit coefficients is required.

Polyhedral Domain.

Numerical domains such as Polyhedra, and restricted forms such as Symbolic Ranges, two variable polyhedra and so on, compute linear inequality invariants over the program variables. Together, they represent various levels of trade-off between the strength of the invariants against the complexity of the analysis.

F-Soft implements numerous abstract domains including intervals, octagons, symbolic ranges and polyhedra inside a partially path-sensitive abstract interpreter. The analysis uses these domains in combination or in succession to attempt to prove a property, each run of the analysis reusing the invariants obtained by the previous runs.

Path Program Enumeration

Let

be a control flow graph with a given property ψ:n,φ under verification. We first present a naive scheme for path program enumeration that simply enumerates the path programs one after another. This is improved by encoding the set of all path programs as a SAT formula and using blocking clauses to eliminate a large set of path programs in one step.

All-path enumeration considers all the syntactic paths in the CFG starting from the initial node n₀ and leading upto the property node n in turn. Each enumerated path is checked if a violation of the assertion φ may occur. However, all-path enumeration is bound to fail for most programs, since the number of paths is infinite for programs with loops, and secondly, checking the possibility of a violation of φ is undecidable over the paths. The system uses the following improvements over all-path enumeration:

-   -   1. The enumeration is performed over path programs obtained as         simple paths from the MSCC decomposition G_(D) of the CFG. Since         G_(D) is a DAG, the number of paths leading upto the node n in         G_(D) is finite.     -   2. The feasibility check for each path chosen and the associated         property verification is performed using sound but incomplete         abstract interpretation techniques. Such techniques can soundly         detect paths that satisfy the property. However, they may suffer         from the problem of false positives. I.e, if they detect         violations of the property, such violations may be the result of         false alarms due to the incompleteness in the abstract domain.     -   3. Finally, conflict clauses learned through the analysis of a         single path program are used to prove the property for a set of         related paths φ. The enumeration scheme stores the set of paths         symbolically to avoid enumeration of these related paths.

Path Program Enumeration

Let G denote the original CFG corresponding to a program

and G_(D), its MSCC decomposition. Let n, φ be a property under verification. Let m be the MSCC containing n in the graph G_(D) and m₀ be the MSCC containing the initial node n₀. A path π_(D) in the graph G_(D) program the initial node m₀ to the target node m represents an (infinite) set of paths in the graph G wherein each visit to a non-singleton MSCC in G_(D) is substituted by its constituent nodes in G.

The overall verification scheme by path program enumeration is shown in the following pseudo-code to verify a property over a CFG by path enumeration.

The scheme does not yet address issues such as the actual representation of the set P and the various steps involved including the abstract interpretation, computing conflict paths and the path slicing for alarms. The verification proceeds by encoding the set P of all paths in the MSCC graph G_(D) leading from n₀ to the property n. A symbolic encoding technique is used for achieving this step. For each selected path π, an abstract interpreter over a set of suitably chosen domains is used to compute a flow-sensitive map η for each node appearing in the path π (Line 5). Based on the result of the abstract interpreter at the target node, no violation may occur. In this case, the result of the abstract interpreter may be used to extract a set of paths Q ⊂ P (Line 7) such that π ∈ Q and no path in Q can lead to a violation of the property. On the other hand, if the abstract interpreter fails to prove the property, we use a path slicing technique on the path π in order to extract a set of related paths S (Line 9) such that π ∈ S and each path in S may lead to a possible violation. In practice, S is represented by a set of program statements that may be directly presented to the user as an alarm. The enumeration proceeds by removing paths in S from further consideration.

Analyzing Path Programs

Let π be a path through G_(D). Such a path gives rise to a subset N_(π) of the nodes and E_(π) of the edges in the CFG. Let G_(π) represent the subset of the original CFG constructed by removing nodes and edges not appearing the path π. Let η:N_(π)

2^(Σ) be an inductive (fixed-point) map that associates each location n ∈ N_(π) in the path π with an invariant set η(n), valid over all executions that do not visit nodes or traverse edges outside the sets N_(π) and E_(π), respectively. This map is computed by running an abstract interpreter over the CFG formed by the restricted node and edge sets respectively. By the soundness of the abstract interpretation, if η(n)⊂φ, then all executions leading from n₀ to n along the nodes/edges in π do not lead to a violation.

For example, consider the path π

$1\overset{y:=p}{\rightarrow}{2\overset{p \neq 0}{\rightarrow}{3\overset{{flag}:=1}{\rightarrow}{6\overset{i:=0}{\rightarrow}{\left\{ {8,10} \right\} \overset{i \geq c}{\rightarrow}{11\overset{{flag} > 0}{\rightarrow}12}}}}}$

in the program from FIG. 4. A simple numerical domain abstract interpreter can compute the invariant (the entire map η is not shown here)

η(12):y=p̂p≠0̂i=ĉflag=1,

at location 12. This invariant suffices to establish the property 12, y≠0 at this location, showing that the path(s) in question cannot lead to a violation.

On the other hand, a closer look at the invariant reveals that the edges 1→2 and 2→3 suffice to establish this invariant in the path. A related path ξ such as

$1\overset{y:=p}{\rightarrow}{2\overset{p \neq 0}{\rightarrow}{3\overset{{flag}:=1}{\rightarrow}{6\overset{c < 0}{\rightarrow}{7\overset{i:=0}{\rightarrow}{\left\{ {8,10} \right\} \overset{i \geq c}{\rightarrow}{11\overset{{flag} > 0}{\rightarrow}12}}}}}}$

that traverses the relevant edges and preserves reaching definitions for the variable y at line 12 also proves the property.

Given a path π and the result η of the abstract interpretation over N_(π),E_(π), a subset of nodes and edges is computed along the path that suffices to prove a given property n,φ. This is achieved in two steps: (a) The map η is generalized by iteratively pruning away the conjuncts from the invariant computed at each node, retaining a minimal subset that is sufficient to prove invariance. (b) Based on the result of the pruning, a set of nodes and edges that suffice to prove the property of interest is obtained.

Pruning Invariants.

A minimal support set is defined next. Let Q: q₁, . . . , q_(m) and q be first order assertions over program variables (possibly belonging to some theory such as linear arithmetic) such that q₁̂ . . . ̂q_(m)

holds.

A subset Q′ ⊂ Q is said to support the inference ̂_(q) _(i) _(∈Q) q_(i)

w.r.t the consequence q iff ̂_(q) _(j) _(∈Q′) q_(j)

A support set Q′ is minimal iff no subset of Q′ can support Q.

In one example, assertions q₁: i≧j, q₂: j≧k+1, q₃: i≧k+1, q₄: k≧1 together imply the assertion q: i≧2 in the theory of linear arithmetic over integers. The subset {q₁,q₂,q₄} by itself suffices to establish q and is thus a minimal support set. The minimal support set is not unique. The set {q₃, q₄} also forms a minimal support set for the implication.

Let η be a fixed point computed using abstract interpretation that establishes a property n, φ. Without loss of generality, it is assumed that the property n is a terminal node of the CFG N_(π),E_(π). As a result η(n)

. Starting with the property node n, let η(n) be represented as a conjunctive assertion q₁ ̂ . . . ̂ q_(m). It follows that there exists a minimal support set Q ⊂ q₁, . . . , q_(m) that supports the implication η(n)

Since η is a fixed point, for every edge e:n₁→n₂∈E_(π),

η(n₁)[V]̂ρ(e)[V,V′]

(n₂)[V′]

Let μ⁰ be the map obtained by modifying q as follows:

${\mu^{0}(m)} = \left( \begin{matrix} {\eta (n)} & {m = n} \\ \; & {m \neq n} \end{matrix} \right.$

In effect, the map μ₀:N_(π)

2^(Σ) maps the property node n to the assertion η(n) and all other nodes to. The map may not, in general, be an inductive fixed point map. It may fail the consecution property for the incoming edges to the node n. The system obtains an iterative series of maps μ⁰, . . . , μ^(N), μ^(N+1) such that:

-   -   1. μ^(i) may not be inductive, for i<N.     -   2. μ^(N+1) is inductive, and proves the property n, φ.     -   3. For each iterate μ^(i), and for each node m, the assertion         μ^(i)(m) consists of a subset of conjuncts from η(m). As a         result η(m)         (m).     -   4. Each successive map incorporates at least as many conjuncts         from η as the previous, I.e.,

(∀i<j),(∀m∈N _(π))μ^(j)(m)

(m)

Local Repair.

The failure of μ^(i) for i<N to be an inductive invariant is handled by local repair. Local repair consists of adding conjuncts from η(m) into μ^(i)(m) for each node m. Since μ^(i) is not inductive, let a→b be an edge in the CFG such that (μ^(i)(a),a→b),

(b), causing μ^(i) not to be a fixed point. However,

η(α)[V]̂ρ(e)[V,V′]

(b)[V′], and η(b)

(b)

Let Q_(a) be a minimal subset of conjuncts from η(a) that supports the implication above. Local repair of μ^(i)(a) w.r.t a→b adds the conjuncts in the set Q_(a) to μ^(i+1)(a) in order to minimally support the implication across the edge a→b. This yields a new map μ^(i+1). Such a repair is always possible since η(a) itself implies the invariant μ^(i)(b).

Let η be a fixed point map and μ⁰, . . . , μ^(i), . . . be a sequence of maps wherein μ^(i+1) is obtained from μ^(i) by local repair of some failing edge using assertions from η. This process converges when μ^(i) is inductive. The process of repeated local repair terminates in finitely many steps yielding a fixed point map μ.

TABLE 2 Invariant maps η and local repair iteration w.r.t the property 12, y ≠ 0. n η(n) μ⁰(n) μ¹(n) μ²(n) . . . μ⁷(n) 1 true true true true . . . true 2 y = p true true true . . . y = p 3 y = p

 p ≠ 0 true true true . . . p ≠ 0

 y = p 6 η(3)

 flag = 1 true true true . . . p ≠ 0

 y = p 8 η(6)

 c ≧ 0

 i ≦ c true true p ≠ 0

. . . p ≠ 0

 y = p y = p 10 η(6)

 c ≧ 0

 i < c true true p ≠ 0

. . . p ≠ 0

 y = p y = p 11 η(8)

 i = c true p ≠ 0

μ¹(11) . . . p ≠ 0

 y = p y = p 12 η(11) p ≠ 0

μ⁰(12) μ⁰(12) . . . p ≠ 0

 y = p y = p

Consider the path π from path-running-example recalled below:

$1\overset{y:=p}{\rightarrow}{2\overset{p \neq 0}{\rightarrow}{3\overset{{flag}:=1}{\rightarrow}{6\overset{i:=0}{\rightarrow}{\left\{ {8,10} \right\} \overset{i \geq c}{\rightarrow}{11\overset{{flag} > 0}{\rightarrow}12}}}}}$

Abstract interpretation using a set of standard numerical domains yields the map η as shown in invariant-map-example. The property y≠0 at line 12 is minimally supported by the conjuncts p≠0̂y=p in η(12). This leads us to form the initial map μ⁰. This map is not inductive due to the failing edge 11→12. Therefore, a local repair yields the map μ¹. Subsequent local repair iterations propagate the supporting conjuncts towards the beginning of the path μ. The iteration converges in 7 steps yielding the final map μ⁷.

Using a repeated process of local repair, the system extracts a minimal invariant map that is inductive and continues to establish the property of interest. This map is then used to extract the minimal set of conflict edges that support the proof of the property.

Conflict Edges.

Let η be a fixed point for a path π establishing a property ψ and let μ be an inductive map for ψ obtained using the local repair iteration. The conflict edges C_(π) consists of a subset of E_(π) of relevant edges (defined below) that are sufficient for the proof of ψ. Such a set is obtained by collecting relevant assignment edges as well as conditions.

Next, conflict edges are discussed.

Definition (conflict edges). An assignment edge

${e\text{:}\mspace{11mu} a}\overset{x}{\rightarrow}b$

is relevant w.r.t. μ iff the consecution condition (μ(a),e)

(b) ceases to hold if the assignment is locally altered from x to a non-deterministic assignment to the variable x. A condition edge

${e\text{:}\mspace{11mu} a}\overset{q{(\;)}}{\rightarrow}b$

is relevant w.r.t μ iff μ(a)

( ) and μ(b)

( ). A minimal set of relevant edges corresponding to a path program and a given invariant map forms a set of conflict edges.

Non-deterministic Choice Replacement—Let C_(π) be a set of relevant edges w.r.t a map μ. Furthermore, let us replace each irrelevant assignment edge in E_(π) by a non-deterministic assignment to the same variable and replace each irrelevant condition by to obtain CFG π′. The map μ remains a valid inductive map for the CFG π′.

Returning to the result of local iteration from path-local-repair, the relevant edges for the path π include the edges

$1\overset{yp}{\rightarrow}{{2\mspace{14mu} {and}\mspace{14mu} 2}\overset{p \neq 0}{\rightarrow}3.}$

The repair iteration presented thus far bears certain similarities to the process of counterexample-based abstraction refinement. Repair iteration is carried out using a property proof along a path program, which is analogous to a false counterexample path through the model. However, counterexample refinement refines an abstraction using predicates or facts derived from the false counterexample. On the other hand, no such abstraction can be said to exist naturally in our framework. The repair iteration serves in our framework to identify a relevant set of conflict edges so that path programs visiting these edges need not be considered further. In particular, the SAT formula used to encode path programs is not an abstraction of the program.

Symbolic Execution

As an alternative to abstract interpretation, path programs can be analyzed conservatively using symbolic execution. However, the presence of loops requires that the assignments in the loop be treated conservatively. This is different from standard symbolic execution wherein all loops are traversed for a fixed number of iterations, yielding (at best) an under-approximation rather than an over-approximation of the path program semantics.

Formally, let π be a path program represented by nodes N_(π) and edges E_(π). Let L_(π) be a set of loops that are visited by the path program π. An over-approximate symbolic execution of the path program π consists of a formula ψ_(π) in a suitable first-order theory whose unsatisfiability denotes the infeasibility of the path program π. Such a formula can be derived by simply composing the transition relations along the edges visited by the path program π. Edges belonging to loops in the path program are handled conservatively by ignoring conditions occurring along the edges and abstracting assignments encountered as non-deterministic choice. Finally, if a property n,φ is asserted at the terminal node of the path program π, we treat

φ as a condition encountered at the node

For symbolic execution, let

be the logical formula obtained by symbolic execution of the path program

with an assertion

if

as infeasible then any execution of the path program

satisfies

The symbolic execution can be improved by means of simple optimizations such as hoisting loop invariant assignments outside loops. The satisfiability of

does not immediately imply the presence of executions that violate

However, if the path slice of

w.r.t the property

is satisfiable(Cf. Jhala & Majumdhar [18]), then

can be shown to contain a violation of the property (provided all loops are guaranteed to terminate).

Recall the path

from the program in path-running-example:

1  → 2 →  3  → 6 →  { 8 , 10 }  → 11 →  12  (  0 ) .

Symbolic execution of this program treats the assignment to the variable

in the MSCC {8,10} as a non-deteriminstic choice. The result of the symbolic execution is obtained by composing the transition relations of the individual edges as follows:

${\begin{bmatrix} {{\text{:}\mspace{14mu} ( = )}{\mspace{14mu} \left( {\neq 0} \right)}{\mspace{14mu} {()}}} \\ {{\mspace{14mu} \left( {= 0} \right)}} \end{bmatrix}}.$

The subscripts on the variables occurring in the transitions are derived by computing the SSA-form of the program π or using a use-def chain analysis. Note that go, is infeasible, indicating that π satisfies the property 12,φ.

The conflict set is determined from the results of the symbolic execution. Let ψ: ρ₁ ̂ . . . ̂ ρ_(m) be an infeasible formula obtained from a path program π. Furthermore, let R={ρ_(i) ₁ , . . . ρ_(i) _(k) } be an unsatisfiable core for the formula ψ and C={e_(i) ₁ , . . . , e_(i) _(k) } be the subset of edges that yield the transitions present in the set R. The set C forms a conflict set for the infeasibility of π.

Formally, let C be a subset of edges obtained from the unsatisfiability core of ψ_(π) for a path program π. Let π′ be obtained from π by replacing the transition relations for edges not in C with.

Next, conflicts from symbolic execution is discussed. The path program π′ continues to satisfy the property n,φ.

As a result, the set C obtained from an infeasible symbolic execution of the path program serves an identical purpose as that obtained through repair iteration following an abstract interpretation proof. Returning to the formula ψ_(π) from symex-ex-1, the unsatisfiable core consists of the transition relations {ρ1,2, ρ_(2,3)} along with the property φ. This yields the conflict set C={1→2, 2→3}. The set C is identical to the result of repair iteration from repair-iteration-conflict.

The power of symbolic execution over a conservative abstract interpretation lies in the ability of fast solvers to reason about the feasibility of large formulae in theories such as linear arithmetic or bit-vectors. On the other hand, the over-approximate treatment of loops in the symbolic execution means that properties that depend on loops, or properties occurring inside loops cannot be handled effectively.

In practice, a combination of symbolic execution over non-loop nodes and abstract the loop nodes using the computed invariants is used. Doing so requires the computation of the unsatisfiability core of ψ_(π) in order to identify the necessary loop invariants. These loop invariants are used as the initial map for a repair iteration to yield the set of edges necessary for the invariants that belong to the unsatisfiability core.

Interference.

Given a path π leading from n₀ to a property Ψ: n,φ, a CFG obtained by the nodes and edges in π (N_(π),E_(π)) has been analyzed to obtain a fixed point map η. Assuming that η proved the property in question, a reduced map μ is obtained which in turn provides a subset C_(π) ⊂E_(π) of relevant edges for the property.

The set of paths Q is characterized next, leading to n in the original CFG that are also guaranteed to satisfy the property Ψ. Conditions are formulated for paths ξ from n₀ on to n that traverse all the edges in C_(π) in order to incorporate the same relevant edges for the property Ψ, thus guaranteeing that ξ also satisfies the property Ψ. Potentially interfering assignments in the CFG are addressed next.

FIG. 4B shows an example program and its CFG representation. A path program π leading to the property 9,i<(a) is highlighted by solid coloured lines. FIG. 4B shows an example program with its CFG as constructed by F-Soft. Dynamic allocation and assignment to the pointer a is modelled by a variable (a) tracking its allocated length. The program assertion 9, i<(a) is added to check for possible overflows due to the access a[i] in line 8. The nodes and edges of the chosen path program π are highlighted in the figure.

The property is easily verified over the path π using an abstract interpretation over the octagonal domain. The relevant invariants at node 9 that enable us to verify this property are i<n̂n=(a). Furthermore, the relevant edges in the conflict set C_(π) are

${{e_{1}\text{:}\mspace{14mu} 3}\overset{{(a)}n}{\rightarrow}4},{{e_{2}\text{:}\mspace{14mu} 7}\overset{i < n}{\rightarrow}9},{{e_{3}\text{:}\mspace{14mu} 6}\overset{i\; 0}{\rightarrow}{{7\mspace{14mu} {and}\mspace{14mu} e_{4}\text{:}\mspace{14mu} 9}\overset{{ii} + 1}{\rightarrow}7.}}$

Consider the path ξ that differs from π in the edge 4→7.

${{\xi \text{:}\mspace{14mu} 2}\overset{n > 0}{\rightarrow}{3\overset{{(a)}n}{\rightarrow}\left. 4\rightarrow{5\overset{{(a)}0}{\rightarrow}{6\overset{i\; 0}{\rightarrow}7}} \right.}},9$

The path ξ also traverses all the edges in C_(π). Nevertheless, ξ leads to a property violation whereas π does not. The key reason is that the assignment (a)0 in the edge 5→6 interferes with the conflict set C_(π).

The definition for interference is discussed next. Let C_(π) be a conflict set corresponding to a path program π in the CFG. An edge e ∉ E_(π) interferes with C_(π) iff there exist a pair of edges e₁, e₂ ∈ C_(π) forming a use-def chain such that e₁:assigns (x) and e₂: uses (x). Furthermore, e assigns the variable x and there exists a syntactic path ξ that visits e between e₁ and e₂. e₂ may also represent the monitor edge for the property under consideration if it depends on the variable x.

Returning to the previous example, the edge 3→4 and the monitor for the property 9, i<(a) form a use-def chain that is interfered by the edge 5→6, which re-assigns the variable (a).

In order to find all interfering edges, pairs of edges e₁, e₂ in the conflict set (including the property) such that e₁ assigns some variable x and e₂ uses the variable are considered. An edge e in the CFG that is (a) forward reachable from the sink of e₁, (b) backward reachable from the source node of e₂ and (c) assigns to the variable x is a potential interfering edge. Such edges can be found simply through a control flow analysis of the CFG. Let I_(π) be a (super-)set of potentially interfering edges for a conflict set C_(π).

If π is proven not to violate a given property Ψ:n,φ, then any path program (from n₀ to n that visits all the nodes in C_(π) and none of the nodes in I_(π) also satisfies the property.

Thus the conflict set C_(π) and the interfering nodes I_(π) describe the set Q of paths that do not violate the property Ψ, provided π is shown to satisfy Ψ.

Handling Violations

If for a given path program π the fixed point obtained by abstract interpretation does not prove a given program assertion n,φ then it follows that a violation of the property may exist. However, the incompleteness of the abstract domain does not allow us to be certain of a property violation. In practice, static analysis tools raise warnings upon discovering potential violations. Our tool can also provide a similar warning. Furthermore, the path π itself can provide a good trace to aid the user diagnosis.

The analysis expands on a potential warning to include other paths related to the warning by using a standard path-slicing algorithm along the lines of previous work of Jhala and Majumdhar. The path slicing algorithm starts from the set of variables relevant to the property and proceeds to mark each edge in the path π as being relevant with respect to the reachability of the node n and the values of the variables involved in the property φ.

The system applies path slicing techniques as described by Jhala and Majumdar to minimize potential error traces. Path slicing returns a subsequence of a path whose infeasibility implies the infeasibility for a path and whose feasibility implies the feasibility of a variant path, but it is only applied to minimize potentially feasible paths, not infeasible paths. This is due to the fact that the support sets can be shown to correspond to subsequences that are at least as small as those returned by a path slicing algorithm.

As a result of path slicing, a set S_(π) ⊂ E_(π) of edges relevant to the property and a set I_(π) of interfering edges that may interfere with the use-def chains in S_(π) are obtained. According to Jhala & Majumdhar, if S_(π),I_(π) be as computed by the path slicing technique, any path ξ that visits all the nodes in S_(π) and none of the nodes in I_(π), ξ violates the property n,φ iff π does.

Encoding Path Programs

A Boolean SAT-based encoding of all the path programs in a given CFG starting from the initial node and reaching a given target node n is discussed next. The encoding consists of a propositional variable X_(e) corresponding to the occurrence of each edge e in a path program. Let G: (N. E) represent the original CFG and G_(D): (N_(D), E_(D)) represent its MSCC decomposition.

Let outgoing(m) denote the set of outgoing edges in E_(D) for a node m∈N_(D). Similarly incoming(m) denotes the set of incoming edges. source(e) and target(e) denote the source and target nodes of an edge e ∈ E_(D). Finally, for a subset of edges E_(s), let exactlyOne(E_(s)) stand for the constraint the exactly one edge from E_(s) occurs in a path. This is represented by the Boolean formula:

$\left. {\underset{e \in E_{s}}{}{X_{e}\underset{e,{f \in E_{s}},{e \neq f}}{}X_{e}}}\Rightarrow{X_{f}} \right.$

The following constraints characterize the set of all path programs:

-   -   The initial node and property node must be visited.         -   exactlyOne(outgoing(n₀)) A exactlyOne(incoming(n))     -   For each edge e∈E_(D) s.t. e ∉ outgoing(n₀), exactly one of its         predecessors (in G_(D)) is visited.         -   X_(e)             exactlyOne(incoming(source(e)))     -   For each edge e ∈ E_(D) s.t. e ∉ incoming(n), exactly one of its         successors (in G_(D)) is visited:         -   X_(e)             exactlyOne(incoming(target(e)))

As a result of the encoding, a Boolean formula Λ(G) over the set of propositional variables {X_(e)|e∈E_(D)} is obtained. For each solution, a path through the graph G_(D) starting at n₀ and reaching the MSCC corresponding to the node n is obtained. Such a path can be translated into a path program over the original CFG. The enumeration of all the path programs in the CFG can be treated as an all-sat enumeration of the solutions to the formula Λ(G).

The elimination of conflict sets and the expansion of alarms by side path analysis can all be incorporated into the SAT formula by means of a blocking clause.

Let C_(π), I_(π) represent the conflict and interfering edges corresponding to a path program π that satisfies a given property. Any path that visits all the edges in C_(π) and none of the edges in I_(π) is also guaranteed to satisfy the property and need not be considered further. This is incorporated in the enumeration by adding the following blocking clause:

$\underset{e \in C_{\pi}}{}{X_{e}}\underset{f \in I_{\pi}}{}X_{f}$

The blocking clause above encodes paths that either do not visit some node of C_(π) or do visit some node of I_(π). By adding such a blocking clause to the SAT formula, the enumeration to such paths is restricted in the future. The sets S_(π),I_(π) obtained as a result of slicing a violation are also treated similarly.

In one embodiment, the analysis technique based on path-sensitive analysis has been implemented as a part of the F-Soft program verification platform for C and C++ programs. F-Soft implements utilities for parsing C programs, constructing memory models, instrumenting checks for properties such as buffer overflows, string API usage, NULL pointer dereferences, user-defined type-state properties and so on. The initial model constructed by the front-end is flattened by expanding compound types into simple types. Pointers are provided addresses and indirections to pointers are expanded based on the results of a flow-insensitive point-to analysis. This model is further analyzed using a series of analyses such as constant folding, interval analysis and other numerical domain analyses based on domains such as octagons, symbolic ranges and polyhedra. The static analyzer is flow and context-sensitive. Context sensitivity is achieved in our static analyzer by inlining all the function calls and returns, treating them as go to statements. While this entails a large blowup in the model size, the size of the model has been found to remain within scalability limits of our static analysis algorithms. Recursion is handled unrolling recursive calls to a fixed depth and treating calls beyond this depth context-insensitively. After each analysis stage, the properties proved by the stage are removed from the model. The model is simplified by repeatedly slicing and constant-folding to reduce the model size.

Pseudo-code for this implementation is as follows:

The initial SAT formula φ₀ is formed by traversing the inlined CFG at the start of the analysis. For each property in turn, the analysis produces path programs from the solution to the SAT formula. The path programs are first analyzed using symbolic execution. If the result of the symbolic execution establishes the property, the conflict edges are obtained using an unsatisfiability core computation. Currently, the Yices SMT solver is used to perform the symbolic execution over the theory of linear arithmetic. If the symbolic execution fails and furthermore that path program consists of loops, an abstract interpretation is performed over the path program. The resulting fixed point is minimized with respect to the property using the repair iteration process described previously.

Currently, support set and unsatisfiability core computation is performed using the SMT solver Yices. Since the Yices API lacks direct support for unsat-core generation, one implementation uses repeated satisfiability checks by removing the conjuncts in the antecedent in order to compute unsatisfiability cores. If a path program cannot be proved using symbolic execution or abstract interpretation, it is sliced and presented as a potential witness. Currently, this implementation stops analyzing a given property upon encountering a potential witness, moving on to the next property to be analyzed.

An application of the system to path-sensitive property verification for C/C++ programs using the F-Soft program verification framework has been done. Tests show that the combination of powerful numerical domain abstract interpretation techniques with SAT-based enumeration can prove properties and indicate potential violations in the large.

FIG. 5 shows an exemplary process to learn and utilize conflict sequences derived from unsatisfiable cores, which are obtained from infeasible symbolic executions. Symbolic execution techniques explore program paths using a constraint solver to generate enabling constraints for the chosen program paths. Satisfiable constraints, corresponding to feasible program paths, may be used to generate tests. On the other hand, unsatisfiable constraints that correspond to infeasible paths are frequently ignored by existing approaches.

Given an unsatisfiable set of constraints, its unsatisfiable core is used to infer a sequence of conflicting program edges which may not appear together in any execution. These derived conflict sequences provide non-trivial structural invariants of the program.

The process of FIG. 5 extracts an unsatisfiable core for each infeasible symbolic execution. An unsatisfiable core is a subset of the original set of constraints that is itself unsatisfiable. From an unsatisfiable core, the process extracts a sub-sequence of conflicting program statements that cannot be traversed by any feasible path through the program. These statements form a compact “reason” for the infeasibility of the program path. Many different infeasible paths through the program may share the same conflict sequence. Thus, the conflict sequences may be used to improve the efficiency of the symbolic execution algorithm itself by avoiding expensive symbolic execution and satisfiability checks over paths that match previously computed conflict sequences.

Referring now to FIG. 5, the process receives as input a program for which test cases are generated in 500. The process selects a path for symbolic execution in block 501. The process chooses paths through the program using a predetermined heuristic for this purpose and symbolically executes them in block 504. In block 502, the process checks before each constraint computation in block 503 whether the chosen path matches a conflict sequence derived earlier. If a match is obtained, the process loops back to block 501 to process the next path and an expensive satisfiability check is avoided since the chosen path is guaranteed to be infeasible as well.

If the symbolic execution is satisfiable in block 504, then the execution uses the satisfiable solution to extract tests for the path in block 505. If the execution constraint is unsatisfiable then that path is no longer explored, the process extracts the conflict sequence from constraints and program description in block 506. The process computes conflict sets (sequences) from unsatisfiable constraints determined in block 504. This consists of computing an unsatisfiable core from the constraints computed by the symbolic execution algorithm and then mapping the core back to the nodes/edges in the CFG.

By using abstract interpretation techniques, the process of FIG. 5 extends these unsatisfiable cores to prove the infeasibility of paths that vary in the number of loop iterations. Together, these infeasible path segments improve symbolic execution techniques by avoiding expensive satisfiability checks for paths that match a previously derived conflict sequence.

FIG. 6 shows the operation of block 506 in more details. First, the process of FIG. 6 extracts unsatisfiable core from a constrained solver in block 601. Next, for each constraint in the unsatisfiable core, the process marks the set of statements that produced the constraint in block 602. The process outputs the marked blocks in the sequence along with relevant variables at each marked note in block 603. The process checks in block 604 whether the conflict sequence in block 603 involve paths inside a loop. If not, the process outputs a non-loop conflict sequence in block 605. Alternatively, if the conflict sequence is inside a loop, the process computes a path regular expression for the execution and extracts a flow graph from the conflict sequence in block 606. Next, the process adds extra counter variables to instrument loops in the flow graph in block 607. Next, in block 608, the process runs a sound static analysis on the flow graph extracted in block 604. The process then extracts the loop sequence along with conditions on the counter variables from the static analysis results in step 609. The process then outputs a loop conflict sequence in block 210.

The conflict sequences are quite compact in practice. Further, they are shared by many different paths through the program. However, conflict sequences frequently contain repeated instances of statements inside loops in the program. This is especially true of loops whose bodies contain conditional branches. Frequently, such branches handle special iterations of the loop. In these situations, the conflict sequences obtained are specific to the actual number of loop iterations. Therefore, a conflict obtained from an execution that iterates a loop m times cannot prove the infeasibility of paths that traverse loops for n≠m iterations. This results in numerous, long conflict sequences that are not useful in proving infeasibility of other paths. In order to treat this common phenomenon, the process of FIG. 6 uses a path-based abstract interpretation technique to reason about the feasibility of path regular expressions. Path regular expressions capture the effect of iterating through the loops in the path arbitrarily many times. This is similar, in principle, to the path invariant approach used to refine predicate abstractions. Using abstract interpretation and widening over off-the-shelf abstract domains allows us to roll-up loops and reason about paths that iterate through them arbitrarily many time. As a result, the process obtains compact loop conflicts that match a large number of infeasible paths through a CFG.

The conflict sequences obtained using the processes of FIGS. 1 and 2 can avoid unnecessary symbolic execution. Furthermore, they can also be used as invariant facts about the overall program behaviour. The information so obtained can be used to improve static analysis by avoiding data-flow contributions over program paths that traverse these infeasible segments. The enhancement of symbolic execution with unsatisfiable cores is independent of the actual strategy for traversing the paths in the program.

The system may be implemented in hardware, firmware or software, or a combination of the three. Preferably the invention is implemented in a computer program executed on a programmable computer having a processor, a data storage system, volatile and non-volatile memory and/or storage elements, at least one input device such as a keyboard and at least one output device such as a display.

Each computer program is tangibly stored in a machine-readable storage media or device (e.g., program memory or magnetic disk) readable by a general or special purpose programmable computer, for configuring and controlling operation of a computer when the storage media or device is read by the computer to perform the procedures described herein. The inventive system may also be considered to be embodied in a computer-readable storage medium, configured with a computer program, where the storage medium so configured causes a computer to operate in a specific and predefined manner to perform the functions described herein.

The invention has been described herein in considerable detail in order to comply with the patent Statutes and to provide those skilled in the art with the information needed to apply the novel principles and to construct and use such specialized components as are required. However, it is to be understood that the invention can be carried out by specifically different equipment and devices, and that various modifications, both as to the equipment details and operating procedures, can be accomplished without departing from the scope of the invention itself. 

1. A method to verify a program, comprising: symbolically enumerating path programs; verifying each path program to determine correctness with respect to a property; determining a conflict set from the path program if proven correct; and using the conflict set to avoid enumerating related path programs that are correct.
 2. The method of claim 1, wherein symbolic enumeration of path programs is performed by enumerating solutions to constraints that represent one or more control paths in a program.
 3. The method of claim 2, wherein control paths are enumerated over maximal strongly connected components in the control flow graph of a program.
 4. The method of claim 2, wherein the control paths are bounded to a predetermined depth, comprising enumerating over a control flow graph of the program.
 5. The method of claim 2, wherein a SAT-solver is used to enumerate over control paths.
 6. The method of claim 1, comprising verifying a path program using abstract interpretation.
 7. The method of claim 1, comprising verifying a path program using symbolic execution.
 8. The method of claim 1, wherein the conflict set determination comprises determining a set of sufficient invariants to prove correctness, and identifying conditions to preserve sufficient invariants along other path programs.
 9. The method of claim 8, comprising deriving a set of sufficient invariants by iterative repairing invariants at one or more control locations based on local supporting sets.
 10. The method of claim 1, wherein the conflict set determination comprises identifying an unsatisfiable core of constraints sufficient to show correctness of the path program, and identifying conditions to preserve the constraints along other control paths.
 11. The method of claim 10, wherein a Satisfiability Modulo Theory (SMT) solver is used to verify a path program, comprising determining an unsatisfiable core if the path program is correct.
 12. The method of claim 1, wherein conflict sets are used to generate blocking constraints for control paths that are also proved correct and need not be enumerated.
 13. The method of claim 1, wherein the conflict sets are used to match against other control paths, and if a match is found, to avoid verifying the associated path program.
 14. The method of claim 1, comprising generating warnings for the path programs not proven correct.
 15. The method of claim 1, comprising generating a program with path programs not proven correct for subsequent verification.
 16. A method to verify a program, comprising: enumerating depth bounded path programs; verifying each path program to determine correctness with respect to a property; determining a conflict set from the path program if proven correct; and using the conflict set to avoid verification of related path programs that are also correct.
 17. The method of claim 16, comprising enumerating control paths over the control flow graph of the program.
 18. The method of claim 17, comprising using a concrete test execution to guide the control path enumeration.
 19. The method of claim 16, comprising verifying a path program using abstract interpretation.
 20. The method of claim 16, comprising verifying a path program using symbolic execution.
 21. The method of claim 16, wherein the conflict set determination comprises determining a set of sufficient invariants that can prove the correctness property, and identifying conditions to preserve sufficient invariants along other control paths.
 22. The method of claim 21, where a set of sufficient invariants is derived by iterative repairing invariants at one or more control locations based on local supporting sets.
 23. The method of claim 16, wherein the conflict set determination comprises identifying an unsatisfiable core of constraints sufficient to show correctness of the path program, and identifying conditions to preserve the constraints along other control paths.
 24. The method of claim 23, wherein a Satisfiability Modulo Theory (SMT) solver is used to verify a path program, and its unsatisfiable core is determined if the path program is correct.
 25. The method of claim 16, wherein conflict sets involving a loop are generalized to apply to an arbitrary number of iterations of the loop.
 26. The method of claim 16, wherein the conflict sets are used to match against other control paths, and if a match is found, to avoid verifying the associated path program. 